<%@ page language="java" 
         contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
        
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="f" %>
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%-- On annonce le datasource par défaut pour cette page --%>
	<sql:setDataSource dataSource="jdbc/baehler"/>	
	
	<sql:query var="vInter" sql="select * from intervention where inter_num = ?">
		<sql:param value="${param.key}"></sql:param>		
	</sql:query>
	
	<table>
	<c:forEach items="${vInter.rows}" var="vRecord">
		<tr>
		<td>${vRecord.inter_num}</td>
		<td>${vRecord.desc_non_défini}</td>
		<td>${vRecord.cust_ref_num}</td>
		<td>${vRecord.type}</td>
		<td><fmt:formatDate value="${vRecord.date_début}" type="date" pattern="dd-MM-yyyy"/></td>
		<td>${vRecord.kilometre}</td>
		<td><fmt:formatDate value="${vRecord.date_fin}" type="date" pattern="dd-MM-yyyy"/></td>
		</tr>
	</c:forEach>
	</table>
	
	<br/>
	<br/>
	<br/>
	
	<sql:query var="vTime" sql="select * from time_log where inter_ref = ?">
		<sql:param value="${param.key}"></sql:param>				
	</sql:query>
	
	<table>
	<c:forEach items="${vTime.rows}" var="vRecord">
		<tr>
		<td><fmt:formatDate value="${vRecord.date_of_work}" type="date" pattern="dd-MM-yyyy"/></td>
		<td>${vRecord.tot_time}</td>
		</tr>
	</c:forEach>
	</table>
		

</body>
</html>